#include <stdio.h>
#include "login_register.h"
#include "user.h"

#include "book.h"
struct H_User* user_head = NULL;
struct H_Book* book_head = NULL;
int main()
{
    //项目的数据准备
    user_head = Create_User_LinkedList();
    book_head = Create_Book_LinkedList();
    int exit_flag = 0;//系统结束标志
    while(1)
    {
        //1. 输出登录界面信息
        printf("*****************登录******************\n");
	    printf("***1. 管理员登录***\n");
        printf("***2. 读者登录***\n");
        printf("***3. 注册账号***\n");
        printf("***4. 退出系统***\n");
        printf("***************************************\n");
        
        //2.获取选项，根据选项执行不同的操作
        printf("请输入相应选项：\n");
        int num;
        scanf("%d", &num);
        
        switch(num)
        {
            case 1:
                //管理员登陆
                admin_login();
                break;
            case 2:
                reader_login();
                break;
            case 3:
                reader_register();
                break;
            case 4:
                exit_flag = 1;
                break;
            default:
                printf("输入有误，请重新输入\n");
                
        }
        if(exit_flag)
            break;
    }
}